<template>
	<view class="content">
		<view class="header">
			<view class="date u-f-ajc" @tap="showPopup=!showPopup">
				<text>2021年8月</text>
				<u-icon style="margin-left: 10rpx;margin-top: -10rpx;" name="arrow-down-fill" color="#ffffff" size="20"></u-icon>
			</view>	
			<!-- 日期筛选遮罩层 -->
			<date-select
				:show="showPopup"
				:start="startTime"
				:end="endTime"
				:type="dateType"
				@submit="onSubmit"
			>
			</date-select>
			<view class="data u-f-ac">
				<view>
					<image class="icon" src="../../static/index/icon-close.png" mode="widthFix"></image>
					<text>加注总量 10000.5kg</text>
				</view>		
				<view>
					<image class="icon" src="../../static/index/icon-close.png" mode="widthFix"></image>
					<text>总金额 5428.5元</text>
				</view>		
			</view>
		</view>	
		<view class="tabs-wrapper u-f-ac">
			<view class="tab u-f-ajc" 
			:class="{'active': tabIndex === index}" 
			v-for="(item,index) in tabs" 
			:key="index"
			@tap="tabIndex=index"
			>
				{{item}}
			</view>	
		</view>	
		<view class="list-wrapper">
			<view class="item u-f-jsb">
				<view class="u-f-ac">
					<!-- <image v-if="true" class="icon" src="../../static/wxImage/charge.png" mode="widthFix"></image> -->
					<!-- <image v-else class="icon" src="../../static/wxImage/consume.png" mode="widthFix"></image> -->
					<view>8月14日 14:35</view>
				</view>
				<view style="font-weight: bold;color: #333333;font-size: 36rpx;">108.00元</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				//日期筛选
				showPopup: false,  //显示日期筛选
				dateType: 0,  //方式，0-按月筛选，1-按日筛选
				year: 2020,  //按月筛选-年份
				month: 1,  //按月筛选-月份
				startTime: '2000-1-1',  //开始日期-提交
				endTime: '2020-1-1',  //结束日期-提交
				tabs: ['全部', '充值', '消费'],
				tabIndex: 0,
			}
		},
		onLoad() {
			
		},
		methods: {
			onSubmit(e) {
				console.log(e);
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #ffffff;
	}
	.header {
		height: 200rpx;
		background: $color-primary;
		
		.date {
			width: 246rpx;
			height: 52rpx;
			color: #ffffff;
			background: #3BC2FC;
			border-radius: 32rpx;
			margin: 30rpx 0rpx 30rpx 50rpx;
			font-size: 34rpx;
			font-weight: bold;
		}
		
		.data {
			margin-left: 50rpx;
			
			text {
				color: #ffffff;
				font-size: 30rpx;
			}
			>view:first-child {
				margin-right: 40rpx;
			}
		}
		
	}
	
	.icon {
		width: 20rpx;
		height: 20rpx;
		margin-right: 6rpx;
	}
	.list-wrapper {
		padding: 0 30rpx;
		background: #ffffff;
		
		.item {
			height: 154rpx;
			padding: 20rpx 0;
			border-bottom: 1rpx solid #E5E5E5;
			view {
				font-size: 32rpx;
				color: #999999;
			}
			
			.icon {
				width: 54rpx;
				height: 54rpx;
				margin-right: 20rpx;
			}
		}
	}
	
	.tabs-wrapper {
		padding: 0 10rpx;
		border: 1rpx solid #E5E5E5;
		.tab {
			width: 160rpx;
			height: 100rpx;
			color: #999999;
			
			&.active {
				color: #333333;
				font-size: 34rpx;
				font-weight: bold;
			}
		}
	}
</style>
